<!--{eval $_G['home_tpl_titles'] = array(getstr($pic['title'], 60, 0, 0, 0, -1), $album['albumname'], '{lang album}');}-->
<!--{eval $friendsname = array(1 => '{lang friendname_1}',2 => '{lang friendname_2}',3 => '{lang friendname_3}',4 => '{lang friendname_4}');}-->
<!--{eval $pic[title] = $pic[title] ? $pic[title] : substr($pic['filename'], 0, strrpos($pic['filename'], '.'))}-->
<!--{eval $pageview = '<a href="home.php?mod=space&username=' .$space[username] . '&do=album">' . lang("home/template","album") . '</a> &raquo; <a href="home.php?mod=space&username=' .$space[username] . '&do=album&id=' . $album[albumid] . '">' . $album[albumname] . '</a> &raquo; ' . $pic[title] ;}-->
<!--{template home/space_header}-->
<!--{template home/space_site_left}-->
<div style="padding-left:10px;">
<!--{subtemplate home/space_short_profile}-->
</div>
<div class="bm z"  style="width:770px;">
<div class="bm_c">
    <div class="tbmu" id="pic_block">
        <div class="y">
            <a href="javascript:;" onclick="imageRotate('pic', 1)"><img class="vm" src="{STATICURL}image/common/rleft.gif" /></a>
            <a href="javascript:;" onclick="imageRotate('pic', 2)"><img class="vm" src="{STATICURL}image/common/rright.gif" /></a><span class="pipe">|</span>
            <a href="home.php?mod=space&uid=$pic[uid]&do=$do&picid=$upid&goto=up#pic_block">{lang previous_pic}</a><span class="pipe">|</span>
            <a href="home.php?mod=space&uid=$pic[uid]&do=$do&picid=$nextid&goto=down#pic_block" id="nextlink">{lang next_pic}</a><span class="pipe">|</span>
            <!--{if $_GET['play']}-->
            <a href="javascript:;" id="playid" class="osld" onclick="playNextPic(false);">{lang stop_playing}</a>
            <!--{else}-->
            <a href="javascript:;" id="playid" class="osld" onclick="playNextPic(true);">{lang start_playing}</a>
            <!--{/if}--><span id="displayNum"></span>
        </div>
        <a href="home.php?mod=space&username=$space[username]&do=album&id=$pic[albumid]">&laquo; {lang return_pic_list}</a>
        <!--{if $album[picnum]}--><span class="pipe">|</span>{lang current_pic}<!--{/if}-->&nbsp;
        <!--{if $album['friend']}-->
        <span class="xg1"> &nbsp; {$friendsname[$value[friend]]}</span>
        <!--{/if}-->
        <!--{hook/space_album_pic_top}-->
    </div>

    <div class="vw pic">

        <div id="photo_pic" class="c{if $pic[magicframe]} magicframe magicframe$pic[magicframe]{/if}">
            <!--{if $pic[magicframe]}-->
            <div class="pic_lb1">
                <table cellpadding="0" cellspacing="0" class="">
                    <tr>
                        <td class="frame_jiao frame_top_left"></td>
                        <td class="frame_x frame_top_middle"></td>
                        <td class="frame_jiao frame_top_right"></td>
                    </tr>
                    <tr>
                        <td class="frame_y frame_middle_left"></td>
                        <td class="frame_middle_middle">
                            <!--{/if}-->
                            <a href="home.php?mod=space&uid=$pic[uid]&do=$do&picid=$nextid&goto=down#pic_block"><img src="$pic[pic]" id="pic" alt="" /></a>
                            <!--{if $pic[magicframe]}-->
                        </td>
                        <td class="frame_y frame_middle_right"></td>
                    </tr>
                    <tr>
                        <td class="frame_jiao frame_bottom_left"></td>
                        <td class="frame_x frame_bottom_middle"></td>
                        <td class="frame_jiao frame_bottom_right"></td>
                    </tr>
                </table>
            </div>
            <!--{/if}-->
        </div>

        <div class="pns mlnv vm mtm cl">
                <a href="home.php?mod=space&username=$pic[username]&do=$do&picid=$upid&goto=up#pic_block" id="pic_up" class="btn" title="{lang previous_pic}"><img src="{STATICURL}image/common/pic_nv_prev.gif" alt="{lang previous_pic}"/></a>
                <!--{loop $piclist $value}-->
                <a href="home.php?mod=space&username=$value[username]&do=album&picid=$value[picid]#pic_block"><img alt="" src="$value[pic]"{if $value[picid]==$picid} class="a"{/if} /></a>
                <!--{/loop}-->
                <a href="home.php?mod=space&username=$pic[username]&do=$do&picid=$nextid&goto=down#pic_block" id="pic_down" class="btn" title="{lang next_pic}"><img src="{STATICURL}image/common/pic_nv_next.gif" alt="{lang next_pic}"/></a>
        </div>

        <div class="d bbs">
            <!--{if isset($_GET['exif'])}-->
                <!--{if $exifs}-->
                    <!--{loop $exifs $key $value}-->
                        <!--{if $value}--><p>$key : $value</p><!--{/if}-->
                    <!--{/loop}-->
                <!--{else}-->
                    <p>{lang no_exif}</p>
                <!--{/if}-->
            <!--{/if}-->
            <div class="o cl bw0 xs1 pbn">
                <a href="home.php?mod=spacecp&ac=share&type=pic&id=$pic[picid]&handlekey=sharealbumhk_{$pic[picid]}" id="a_share_$pic[picid]" onclick="showWindow(this.id, this.href, 'get', 0);" class="oshr">{lang share}</a>

                <!--{hook/space_album_pic_op_extra}-->
                <!--{if $pic[uid] == $_G[uid]}-->
                <!--{if $_G[magic][frame]}-->
                    <img src="{STATICURL}image/magic/frame.small.gif" alt="frame" class="vm" />
                    <!--{if $pic[magicframe]}-->
                    <a id="a_magic_frame" href="home.php?mod=spacecp&ac=magic&op=cancelframe&idtype=picid&id=$pic[picid]" onclick="ajaxmenu(event,this.id)">{lang cancel_frame}</a>
                    <!--{else}-->
                    <a id="a_magic_frame" href="home.php?mod=magic&mid=frame&idtype=picid&id=$pic[picid]" onclick="ajaxmenu(event,this.id, 1)">{lang add_frame}</a>
                    <!--{/if}-->
                    <span class="pipe">|</span>
                <!--{/if}-->

                <!--{/if}-->

                <!--{if $_G[uid] == $pic[uid] || checkperm('managealbum')}-->
                <a href="home.php?mod=spacecp&ac=album&op=editpic&albumid=$pic[albumid]&picid=$pic[picid]">{lang manage_pic}</a><span class="pipe">|</span>
                <a href="home.php?mod=spacecp&ac=album&op=edittitle&albumid=$pic[albumid]&picid=$pic[picid]&handlekey=edittitlehk_{$pic[picid]}" id="a_set_title" onclick="showWindow(this.id, this.href, 'get', 0);">{lang edit_description}</a>
                <!--{/if}-->

                <!--{if checkperm('managealbum')}-->
                <span class="pipe">|</span>IP: $pic[postip]
                <span class="pipe">|</span><a href="home.php?mod=spacecp&ac=album&picid=$pic[picid]&op=edithot&handlekey=picedithothk_{$pic[picid]}" id="a_hot_$pic[picid]" onclick="showWindow(this.id, this.href, 'get', 0);">{lang hot}</a>
                <!--{/if}-->
                <!--a href="home.php?mod=spacecp&ac=common&op=report&idtype=picid&id=$pic[picid]&handlekey=reportpichk_{$pic[picid]}" id="a_report" onclick="showWindow(this.id, this.href, 'get', 0);">{lang report}</a-->

                <span class="z">
                    <a href="$pic[pic]">{lang look_pic}</a>
                    <!--{if !isset($_GET['exif'])}-->
                    <span class="pipe">|</span><a href="$theurl&exif=1">{lang look_exif}</a>
                    <!--{/if}-->
                    <!--{if $_G['group']['allowdiy'] || getstatus($_G['member']['allowadmincp'], 4) || getstatus($_G['member']['allowadmincp'], 5)}-->
                    <span class="pipe">|</span><a href="portal.php?mod=portalcp&ac=portalblock&op=recommend&idtype=picid&id=$pic[picid]" onclick="showWindow('recommend', this.href, 'get', 0)">{lang blockdata_recommend}</a>
                    <!--{/if}-->
                    <!--{if $pic[uid] != $_G['uid']}-->
                    <span class="pipe">|</span><a href="javascript:;" onclick="showWindow('miscreport$pic[picid]', 'misc.php?mod=report&rtype=pic&uid=$pic[uid]&rid=$pic[picid]', 'get', -1);return false;">{lang report}</a>
                    <!--{/if}-->
                    <!--{hook/space_album_pic_bottom}-->
                </span>
            </div>
            <!--[diy=diyclicktop]--><div id="diyclicktop" class="area"></div><!--[/diy]-->
            <!--{if $album[friend] != 3}-->
            <div id="click_div">
                <!--{template home/space_click}-->
            </div>
            <!--{/if}-->
        </div>
    </div>
    <!--[diy=diycommenttop]--><div id="diycommenttop" class="area"></div><!--[/diy]-->
    <div style="line-height:24px;padding-top:20px; text-align:left;">
    	<!--{if $pic['location']}-->
        	Chụp tại: $pic['location']
        <!--{/if}-->
        <!--{if !empty($pic['tagfriends'])}-->
        	cùng với:
            <!--{eval $tgi = 0; $tgc = count($pic['tagfriends']);}-->
            <!--{loop $pic['tagfriends'] $key $value}-->
            	<!--{eval $tgi++}-->
            	<a href="home.php?mod=space&username={$value[username]}" c="1">{$value[username]}</a><!--{if $tgi<$tgc-1}-->,<!--{/if}--><!--{if $tgi == $tgc-1}--> và <!--{/if}-->
            <!--{if $value[username] == $_G['username']}-->
            <!--{eval $removetag = true;}-->
            <!--{/if}-->
            <!--{/loop}-->.
            <!--{if $removetag}-->
            <a href="home.php?mod=spacecp&ac=album&op=removetag&picid={$pic[picid]}" onclick="showWindow('removetag', this.href); return false;">Huỷ tag tôi</a>
            <!--{/if}-->
        <!--{/if}-->
    	</div>
    <p class="xg1 xs1">
        <!--{if $pic[hot]}--><span class="hot">{lang hot} <em>$pic[hot]</em></span><!--{/if}-->
        <!--{if $do=='event'}--><a href="home.php?mod=space&username=$pic[username]">$pic[username]</a><!--{/if}-->
        {lang upload_at} <!--{date($pic[dateline])}--> ($pic[size])
        <!--{if $space[self]}--><span class="xi2"> - <a href="home.php?mod=spacecp&ac=upload" class="addnew">{lang upload_pic}</a></span><!--{/if}-->
    </p>
    <!-- Begin Comment -->
    <div class="cmt hcmd">
    	<i class="x-nhot"></i>
    	<div class="xld xlda">
            <h3 class="ptn pbn bbs ">
                <!--{if $_G['uid']}-->
                <a href="home.php?mod=space&uid=$album[uid]&do=$do&picid=$id#quickcommentform_{$id}" onclick="if($('comment_message')){$('comment_message').focus();return false;}" class="y xi2 xw0">{lang publish_comment}</a>
                <!--{/if}-->
                {lang comment} (<span id="comment_replynum">$countcomment</span> {lang blog_replay})
            </h3>
        </div>
        <div id="comment"  class="mbm">
            <!--{if $cid}-->
            <div class="i">
                {lang current_comment}
            </div>
            <!--{/if}-->
            <div id="comment_ul" class="xld xlda">
            <!--{eval $lastcid = 0;}-->
            <!--{loop $list $k $value}-->
                <!--{template home/space_comment_li}-->
                <!--{eval $lastcid = $value['cid'];}-->
            <!--{/loop}-->
            </div>
        </div>
    <!--{if $_G['uid']}-->
        <div id="form_comment_pic{$picid}" style="padding-right:10px; background-color:#F0F2F7">
            <table cellpadding="0" width="100%">
                <tr>
                    <td valign="top" width="50px">
                        <div class="avt">
                            <a href="home.php?mod=space&uid=$_G['uid']" class="avt_l" c="1">
                                <!--{avatar($_G['uid'],small)}-->
                            </a>
                        </div>
                    </td>
                    <td width="*">
                        <form id="quickcommentform_{$picid}" name="quickcommentform_{$picid}" action="home.php?mod=spacecp&ac=comment&handlekey=qcpic_{$picid}" method="post" autocomplete="off" onsubmit="ajaxpost('quickcommentform_{$picid}', 'return_qcpic_{$picid}');doane(event);">
                                <p>
                                    <span id="comment_face" onclick="showFace(this.id, 'comment_message');return false;" class="cur1"><img src="{IMGDIR}/facelist.gif" alt="facelist" class="vm" /></span>
                                    <!--{hook/space_album_pic_face_extra}-->
                                    <!--{if $_G['setting']['magicstatus'] && !empty($_G['setting']['magics']['doodle'])}-->
                                    <a id="a_magic_doodle" href="home.php?mod=magic&mid=doodle&showid=comment_doodle&target=comment_message" onclick="showWindow(this.id, this.href, 'get', 0)"><img src="{STATICURL}image/magic/doodle.small.gif" alt="doodle" class="vm" title="{$_G['setting']['magics']['doodle']}" /></a>
                                    <!--{/if}-->
                                </p>
                                <textarea id="comment_message" onkeydown="ctrlEnter(event, 'commentsubmit_btn');  resizeTx(this);" onfocus="txtTxCommentChk(this.id, 1); resizeTx(this);" onblur="onckeydown=true; resizeTx(this); txtTxCommentChk(this.id, 2)" name="message" rows="1"  class="pts"  style="color:#CCC;">Viết bình luận...</textarea>        <!--{if checkperm('seccode') && ($secqaacheck || $seccodecheck)}-->
                                <!--{block sectpl}--><sec> <span id="sec<hash>" onclick="showMenu(this.id);"><sec></span><div id="sec<hash>_menu" class="p_pop p_opt" style="display:none"><sec></div><!--{/block}-->
                                <div class="mtm mbm sec"><!--{subtemplate common/seccheck}--></div>
                            <!--{/if}-->
                            <p class="pns" style="margin-left:55px;">
                                <input type="hidden" name="refer" value="$theurl" />
                                <input type="hidden" name="id" value="$picid" />
                                <input type="hidden" name="idtype" value="picid" />
                                <input type="hidden" name="commentsubmit" value="true" />
                                <input type="hidden" name="quickcomment" value="true" />
                                <button type="submit" name="commentsubmit_btn" value="true" style="display:none" id="commentsubmit_btn" class="pn"{if !$_G[uid]} onclick="showWindow(this.id, this.form.action);return false;"{/if}><strong>{lang comment}</strong></button>
                                <span id="__quickcommentform_{$picid}"></span>
                                <span id="return_qcpic_{$picid}"></span>
                                <input type="hidden" name="formhash" value="{FORMHASH}" />
                            </p>
                    	</form>
    				</td>
                </tr>
            </table>
        </div>
   	<!--{/if}-->
    </div>
    <!--{if $multi_comment}--><div class="pgs cl mbm">$multi_comment</div><!--{/if}-->
    <div style="clear:both"></div>
    <!-- END Comment -->
</div>


<!--end bm-->

<!--[diy=diycontentbottom]--><div id="diycontentbottom" class="area"></div><!--[/diy]-->
</div>
<div class="y column" style="width:225px;">
<!--{subtemplate common/ads_right}-->
</div>
	<!-- div class="sd">
		<subtemplate home/space_userabout>
	</div -->
<!--{template home/space_site_right}-->
<script type="text/javascript">
	var picid_lastcid			= $lastcid;
	var pic_id					= $id;
	var pic_viewautoload_$id 	= null;
	
	function _pic_viewautoload_$id(){
		return setInterval(function(){comment_autoload('comment_ul', 'pic');}, 10000);
	}
	jQuery(document).ready(function(){
		pic_viewautoload_$id = _pic_viewautoload_$id();
	});
	function succeedhandle_qcpic_$picid(url, msg, values) {
		if(values['cid']) {
			if($('comment_message')) {
				$('comment_message').value= '';
			}
			pic_viewautoload_$id = window.clearInterval(pic_viewautoload_$id);
			comment_autoload('comment_ul', 'pic');
			pic_viewautoload_$id = _pic_viewautoload_$id();
			setTimeout(function(){
				$('return_qcpic_{$id}').innerHTML = '';
			}, 3000);
		} else {
			$('return_qcpic_{$picid}').innerHTML = msg;
		}
		<!--{if checkperm('seccode') && $sechash}-->
			<!--{if $secqaacheck}-->
			updatesecqaa('$sechash');
			<!--{/if}-->
			<!--{if $seccodecheck}-->
			updateseccode('$sechash');
			<!--{/if}-->
		<!--{/if}-->
	}
	function createElem(e){
		var obj = document.createElement(e);
		obj.style.position = 'absolute';
		obj.style.zIndex = '1';
		obj.style.cursor = 'pointer';
		obj.onmouseout = function(){ this.style.background = 'none';}
		return obj;
	}
	function viewPhoto(){
		var pager = createElem('div');
		var pre = createElem('div');
		var next = createElem('div');
		var cont = $('photo_pic');
		var tar = $('pic');
		var space = 0;
		var w = tar.width/2;
		if(!!window.ActiveXObject && !window.XMLHttpRequest){
			space = -(cont.offsetWidth - tar.width)/2;
		}
		var objpos = fetchOffset(tar);
	
		pager.style.position = 'absolute';
		pager.style.top = '0';
		pager.style.left = objpos['left'] + 'px';
		pager.style.top = objpos['top'] + 'px';
		pager.style.width = tar.width + 'px';
		pager.style.height = tar.height + 'px';
		pre.style.left = 0;
		next.style.right = 0;
		pre.style.width = next.style.width = w + 'px';
		pre.style.height = next.style.height = tar.height + 'px';
		pre.innerHTML = next.innerHTML = '<img src="{IMGDIR}/emp.gif" width="' + w + '" height="' + tar.height + '" />';
	
		pre.onmouseover = function(){ this.style.background = 'url({IMGDIR}/pic-prev.png) no-repeat 0 100px'; }
		pre.onclick = function(){ window.location = $('pic_up').href; }
	
		next.onmouseover = function(){ this.style.background = 'url({IMGDIR}/pic-next.png) no-repeat 100% 100px'; }
		next.onclick = function(){ window.location = $('pic_down').href ;}
	
		//cont.style.position = 'relative';
		cont.appendChild(pager);
		pager.appendChild(pre);
		pager.appendChild(next);
	}
	$('pic').onload = function(){
		viewPhoto();
	}
	
	var interval = 5000;
	var timerId = -1;
	var derId = -1;
	var replay = false;
	var num = 0;
	var endPlay = false;
	function forward() {
		window.location.href = 'home.php?mod=space&uid=$pic[uid]&do=$do&picid=$nextid&goto=down&play=1#pic_block';
	}
	function derivativeNum() {
		num++;
		$('displayNum').innerHTML = '[' + (interval/1000 - num) + ']';
	}
	function playNextPic(stat) {
		if(stat || replay) {
			derId = window.setInterval('derivativeNum();', 1000);
			$('displayNum').innerHTML = '[' + (interval/1000 - num) + ']';
			$('playid').onclick = function (){replay = false;playNextPic(false);};
			$('playid').innerHTML = '{lang stop_playing}';
			timerId = window.setInterval('forward();', interval);
		} else {
			replay = true;
			num = 0;
			if(endPlay) {
				$('playid').innerHTML = '{lang restart}';
			} else {
				$('playid').innerHTML = '{lang start_playing}';
			}
			$('playid').onclick = function (){playNextPic(true);};
			$('displayNum').innerHTML = '';
			window.clearInterval(timerId);
			window.clearInterval(derId);
		}
	}
	<!--{if $_GET['play']}-->
	<!--{if $sequence && $album['picnum']}-->
	if($sequence == $album[picnum]) {
		endPlay = true;
		playNextPic(false);
	} else {
		playNextPic(true);
	}
	<!--{else}-->
	playNextPic(true);
	<!--{/if}-->
	<!--{/if}-->
	
	function update_title() {
		$('title_form').style.display='';
	}
	
	var elems = selector('dd[class~=magicflicker]');
	for(var i=0; i<elems.length; i++){
		magicColor(elems[i]);
	}
</script>
<!--{template common/footer}-->